/**
 * https://leetcode-cn.com/problems/running-sum-of-1d-array/
 * @param {number[]} nums
 * @return {number[]}
 */
var runningSum = function(nums) {
  // if(nums[0] === undefined) return []
  // let result = [nums[0]]
  // nums.reduce((a,b)=>{
  //   result.push(a+b)
  //   return a + b
  // })
  // return result

  let count = 0;
  let result = []
  for(let i = 0;i<nums.length;i++){
    count += nums[i]
    result.push(count)
  }
  return result


};

let arr = []

console.log(runningSum(arr))
